home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 833 b | 38 lines | [TEXT/CWIE] |
- // WindowLocation.cp
-
- #ifndef WindowLocation_h
- #include "WindowLocation.h"
- #endif
-
- WindowLocation::WindowLocation( Rectangle available, PointObject reasonableSize )
- : finished( 0 )
- {
- PointObject availableSize = available.Size();
-
- if ( reasonableSize.h > availableSize.h )
- reasonableSize.h = availableSize.h;
- if ( reasonableSize.v > availableSize.v )
- reasonableSize.v = availableSize.v;
-
- stop.v = available.bottom - reasonableSize.v;
- stop.h = available.left;
-
- location = available.TopLeft();
-
- location.h += 12;
- if ( location.h + reasonableSize.h > available.right )
- location.h = available.right - reasonableSize.h;
- }
-
- void WindowLocation::operator++()
- {
- Assert( Unfinished() );
-
- location += PointObject( -4, 16 );
-
- if ( location.h < stop.h )
- location.h = stop.h;
-
- finished = location.v > stop.v;
- }
-